Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up keyed swap rows benchmark by moving existing DOM elements instead of creating new elements #1249

Merged
merged 2 commits into from
Mar 18, 2018

Conversation

btakita
Copy link
Contributor

@btakita btakita commented Mar 17, 2018

@codecov-io
Copy link

codecov-io commented Mar 17, 2018

Codecov Report

Merging #1249 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #1249      +/-   ##
=========================================
+ Coverage    91.9%   91.9%   +<.01%     
=========================================
  Files         126     126              
  Lines        4556    4559       +3     
  Branches     1486    1486              
=========================================
+ Hits         4187    4190       +3     
  Misses        153     153              
  Partials      216     216
Impacted Files Coverage Δ
src/generators/nodes/EachBlock.ts 98.15% <100%> (+0.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b3fa965...66e4df1. Read the comment docs.

@btakita btakita force-pushed the issues/588 branch 7 times, most recently from ceade29 to 17c9b3a Compare March 18, 2018 07:36
* Performance Improvement with Keyed EachBlock
  * All DOM nodes for existing data are reused between changes to state
  * Speed up Keyed Swap Rows Benchmark
    * https://github.com/krausest/js-framework-benchmark
* Fixed Build
* Introduced jsdom.VirtualConsole
@Rich-Harris
Copy link
Member

This is amazing! If I've understood correctly, you managed to speed up the swapping rows case without negatively impacting anything else, while reducing the amount of code. I ran js-framework-benchmark on this branch and compared it to 1.57.4 — looks like good news all round: http://windy-able.surge.sh/

Thanks so much!

@Rich-Harris Rich-Harris merged commit 10600eb into sveltejs:master Mar 18, 2018
@Rich-Harris
Copy link
Member

(One small observation — some of the hard-coded variable names are vulnerable to conflicts. I haven't edited those yet because I want to see if it's possible to extract this stuff into a helper function instead.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants